package com.zyx.springmvcmsb.response.view;

import org.springframework.web.servlet.View;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.util.Map;

/**
 * @author zyx
 * @since 2021/10/4 08:49
 */
public class MyView implements View {

    @Override
    public String getContentType() {
        return "text/html";
    }

    @Override
    public void render(Map<String, ?> model,
                       HttpServletRequest request,
                       HttpServletResponse response) throws Exception {
        System.out.println("model:" + model);
        response.setContentType("text/html");
        PrintWriter writer = response.getWriter();
        writer.write("<h1>自定义View</h1>");
        writer.write("123321");
    }
}
